package com.g1.service.impl;

import com.g1.entity.Cook;
import com.g1.mapper.CookMapper;
import com.g1.service.CookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CookServiceImpl implements CookService {

    @Autowired
    private CookMapper cookMapper;

    @Override
    public List<Cook> selectAll() {
        return cookMapper.selectList(null);
    }

    @Override
    public Cook selectById(Long id) {
        return cookMapper.selectById(id);
    }

    @Override
    public int update(Cook cook) {
        return cookMapper.updateById(cook);
    }

    @Override
    public int delete(Long id) {
        return cookMapper.deleteById(id);
    }

    @Override
    public int insert(Cook cook) {
        return cookMapper.insert(cook);
    }
}
